<template>
  <el-dialog :visible="showfindPolicyDialog" title="策略管理" @close="btnClose">
    <el-form label-width="120px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="选择策略：">
            <span>{{ policyList.innerCode }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="选择策略：">
            <span>{{ policyList.policyName }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="选择策略：">
            <span>{{ policyList.discount }}%</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template v-slot:footer>
      <el-row type="flex" justify="center">
        <el-button size="small" style="background:#f3e7e1;font-size: 14px;" @click="btnCancel">取消策略</el-button>
      </el-row>
    </template>
  </el-dialog>
</template>

<script>
import { delPolicy } from '@/api/policy'
export default {
  props: {
    policyList: {
      type: Object,
      required: true
    },
    showfindPolicyDialog: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    async btnCancel() {
      await delPolicy(this.policyList.innerCode, this.policyList.policyId)
      this.$emit('update:showfindPolicyDialog', false)
      this.$emit('editEquipment')
      this.$message.success('取消成功')
    },
    btnClose() {
      this.$emit('update:showfindPolicyDialog', false)
    }
  }
}
</script>

<style>

</style>
